﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="frmListPublisher.aspx.cs" Inherits="BSPortal.Usercontrol.Admin.Book.Publisher.frmListPublisher" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit.HTMLEditor" tagprefix="cc1" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<link href="/css/Style.css" rel="stylesheet" type="text/css" />
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title></title>
   
</head>
<body>
    <form id="form1" runat="server">
     <script language ="javascript" type ="text/javascript" >
         function GetRadWindow() {
             var oWindow = null;
             if (window.radWindow)
                 oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog      
             else if (window.frameElement.radWindow)
                 oWindow = window.frameElement.radWindow; //IE (and Moz as well)      
             return oWindow;
         }

         function Close() {
             var arg = new Object();
             arg.Modified = document.getElementById('<%=hdModified.ClientID %>').value;
             GetRadWindow().Close(arg);
         }
         function getRandomNumber() {
             var randomnumber = Math.random(10000);
             return randomnumber;
         }

         function OnClientAsyncFileUploadComplete(sender, args) {
             var handlerPage = '<%= Page.ResolveClientUrl("~/ImageHandler.ashx")%>';
             var queryString = '?imagefor=publisher&randomno=' + getRandomNumber();
             var src = handlerPage + queryString;
             var clientId = '<%=previewImage.ClientID %>';
             document.getElementById(clientId).setAttribute("src", src);
         }
</script> 
     <asp:ToolkitScriptManager ID="ScriptManager1" runat="server">
     </asp:ToolkitScriptManager>
    <asp:UpdatePanel runat="server" ID="updatePanel1" RenderMode="Inline" UpdateMode="Conditional">
    <ContentTemplate>       
        <asp:Panel ID="Panel1" DefaultButton="btnSave"  runat="server" >
            <br />
            <table style="width:100%; ">                                                                                            
                    <tr>
                        <td></td>  
                        <td align="left">
                            &nbsp;&nbsp;&nbsp;&nbsp; ID:
                        </td>
                        <td align="left">
                            <asp:TextBox ID="txtId" Runat="server" Width="200px" 
                                Enabled="False"></asp:TextBox>                                                           
                        </td>
                    </tr>
                    <tr>
                        <td></td>  
                        <td align="left">
                            &nbsp;&nbsp;&nbsp;&nbsp; <%=publisherName %>:
                        </td>
                        <td align="left">
                            <asp:TextBox ID="txtName" Runat="server" Width="200px"></asp:TextBox>                                                           
                            <asp:RequiredFieldValidator ID="rqfPassword" ControlToValidate="txtName" runat="server" ErrorMessage="(*)" ValidationGroup="ProductPriceNews" ></asp:RequiredFieldValidator>
                        </td>
                    </tr>                    
                    <tr>
                        <td>
                            &nbsp;</td>
                        <td align="left">
                            &nbsp;&nbsp;&nbsp;&nbsp; Hiển thị:
                        </td>
                        <td align="left">
                            <asp:CheckBox ID="chkIsPublished" runat="server"/>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;</td>
                        <td align="left">
                            &nbsp;&nbsp;&nbsp;&nbsp; Hình ảnh:
                        </td>
                        <td align="left">
                        <asp:Image ID="previewImage" runat="server" Width="100px" Height="120px" /><br />
                            <asp:AsyncFileUpload ID="AsyncFileUpload1" runat="server" 
                            ThrobberID="spanUploading"  Width="200px"  UploaderStyle="Modern" 
                            UploadingBackColor="#CCFFFF" OnClientUploadComplete="OnClientAsyncFileUploadComplete"
                                onuploadedcomplete="AsyncFileUpload1_UploadedComplete" /><br />
                                <span id="spanUploading" runat="server">Uploading...</span><br />
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td style="height: 20px;" align="center" colspan="3">
                            <strong>                                                
                            <asp:Label ID="lblStatus" runat="server" CssClass="sm_error" ></asp:Label>
                            </strong>
                        </td>                                                             
                    </tr>                                                  
                    <tr>                                                           
                       <td align="center" colspan="3">                                                                                                                          
                           <asp:Button ID="btnSave" runat="server" CssClass="Submit" Text="Lưu" ValidationGroup="ProductPriceNews" onclick="btnSave_Click" />
                           &nbsp;
                           <asp:Button ID="btnReset" CssClass="Submit" runat="server" Text="Nhập lại" 
                               onclick="btnReset_Click"  />&nbsp;
                           <asp:Button ID="btnCancel" CssClass="Submit" runat="server" Text="Đóng" OnClientClick="Close()"  />
                       </td>   
                   </tr>
                   <tr>                                                           
                       <td align="center" colspan="3">
                        <br />  
                             <asp:UpdateProgress ID="UpdateProgress2"  runat="server" DisplayAfter="10" DynamicLayout="false">
                                    <ProgressTemplate>
                                        <span>
                                           <asp:Image alt="" ID="imgLoading" ImageUrl="~/images/loader2.gif" runat="server" /></span>
                                    </ProgressTemplate>
                              </asp:UpdateProgress>
                       </td>                                                                                                                                                         
                   </tr>                                                  
            </table>
            <asp:HiddenField ID="hdModified" runat="server" />
        </asp:Panel>    
    </ContentTemplate>
    </asp:UpdatePanel>
    </form>
</body>
</html>

